home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / DevCon / Washington_1988 / DevCon88.3 / Printer / src / HP / init.asm < prev    next >
Encoding:
Assembly Source File  |  1992-08-27  |  3.7 KB  |  177 lines

  1.     TTL    '$Header: init.asm,v 1.0 87/08/20 14:12:39 daveb Exp $'
  2. **********************************************************************
  3. *                                     *
  4. *   Copyright 1985, Commodore-Amiga Inc.   All rights reserved.         *
  5. *   No part of this program may be reproduced, transmitted,         *
  6. *   transcribed, stored in retrieval system, or translated into         *
  7. *   any language or computer language, in any form or by any         *
  8. *   means, electronic, mechanical, magnetic, optical, chemical,         *
  9. *   manual or otherwise, without the prior written permission of     *
  10. *   Commodore-Amiga Incorporated, 983 University Ave. Building #D,   *
  11. *   Los Gatos, California, 95030                     *
  12. *                                     *
  13. **********************************************************************
  14. *
  15. *    printer device functions
  16. *
  17. *   Source Control
  18. *   --------------
  19. *   $Header: init.asm,v 1.0 87/08/20 14:12:39 daveb Exp $
  20. *
  21. *   $Locker:  $
  22. *
  23. *   $Log:    init.asm,v $
  24. *   Revision 1.0  87/08/20  14:12:39  daveb
  25. *   added to rcs
  26. *   
  27. *   Revision 1.0  87/08/20  13:30:11  daveb
  28. *   added to rcs
  29. *   
  30. *   Revision 1.1  85/10/09  19:27:38  kodiak
  31. *   remove _stdout variable
  32. *   
  33. *   Revision 1.0  85/10/09  19:23:53  kodiak
  34. *   added to rcs for updating in version 1
  35. *   
  36. *   Revision 29.1  85/08/02  16:58:43  kodiak
  37. *   remove dummy _Close routine -- it's used to finish print of last page.
  38. *   
  39. *   Revision 29.0  85/08/02  16:58:17  kodiak
  40. *   added to rcs for updating in version 29
  41. *   
  42. *   Revision 25.0  85/06/16  01:01:22  kodiak
  43. *   added to rcs
  44. *   
  45. *
  46. **********************************************************************
  47.  
  48.     SECTION        printer
  49.  
  50. *------ Included Files -----------------------------------------------
  51.  
  52.     INCLUDE        "exec/types.i"
  53.     INCLUDE        "exec/nodes.i"
  54.     INCLUDE        "exec/lists.i"
  55.     INCLUDE        "exec/memory.i"
  56.     INCLUDE        "exec/ports.i"
  57.     INCLUDE        "exec/libraries.i"
  58.  
  59.     INCLUDE        "../printer/macros.i"
  60.  
  61. *------ Imported Functions -------------------------------------------
  62.  
  63.     XREF_EXE    CloseLibrary
  64.     XREF_EXE    OpenLibrary
  65.     XREF        _AbsExecBase
  66.  
  67.  
  68.     XREF        _PEDData
  69.  
  70.  
  71. *------ Exported Globals ---------------------------------------------
  72.  
  73.     XDEF        _Init
  74.     XDEF        _Expunge
  75.     XDEF        _Open
  76.     XDEF        _PD
  77.     XDEF        _PED
  78.     XDEF        _SysBase
  79.     XDEF        _DOSBase
  80.     XDEF        _GfxBase
  81.     XDEF        _IntuitionBase
  82.  
  83.  
  84. **********************************************************************
  85.     SECTION        printer,DATA
  86. _PD        DC.L    0
  87. _PED        DC.L    0
  88. _SysBase    DC.L    0
  89. _DOSBase    DC.L    0
  90. _GfxBase    DC.L    0
  91. _IntuitionBase    DC.L    0
  92.  
  93.  
  94. **********************************************************************
  95.     SECTION        printer,CODE
  96. _Init:
  97.         MOVE.L    4(A7),_PD
  98.         LEA    _PEDData(PC),A0
  99.         MOVE.L    A0,_PED
  100.         MOVE.L    A6,-(A7)
  101.         MOVE.L    _AbsExecBase,A6
  102.         MOVE.L    A6,_SysBase
  103.  
  104. *        ;------ open the dos library
  105.         LEA    DLName(PC),A1
  106.         MOVEQ    #0,D0
  107.         CALLEXE OpenLibrary
  108.         MOVE.L    D0,_DOSBase
  109.         BEQ    initDLErr
  110.  
  111.  
  112. *        ;------ open the graphics library
  113.         LEA    GLName(PC),A1
  114.         MOVEQ    #0,D0
  115.         CALLEXE OpenLibrary
  116.         MOVE.L    D0,_GfxBase
  117.         BEQ    initGLErr
  118.  
  119. *        ;------ open the intuition library
  120.         LEA    ILName(PC),A1
  121.         MOVEQ    #0,D0
  122.         CALLEXE OpenLibrary
  123.         MOVE.L    D0,_IntuitionBase
  124.         BEQ    initILErr
  125.  
  126.         MOVEQ    #0,D0
  127. pdiRts:
  128.         MOVE.L    (A7)+,A6
  129.         RTS
  130.  
  131. initPAErr:
  132.         MOVE.L    _IntuitionBase,A1
  133.         LINKEXE    CloseLibrary
  134.  
  135. initILErr:
  136.         MOVE.L    _GfxBase,A1
  137.         LINKEXE    CloseLibrary
  138.  
  139. initGLErr:
  140.         MOVE.L    _DOSBase,A1
  141.         LINKEXE    CloseLibrary
  142.  
  143. initDLErr:
  144.         MOVEQ    #-1,D0
  145.         BRA.S    pdiRts
  146.  
  147. ILName:
  148.         DC.B    'intuition.library'
  149.         DC.B    0
  150. DLName:
  151.         DC.B    'dos.library'
  152.         DC.B    0
  153. GLName:
  154.         DC.B    'graphics.library'
  155.         DC.B    0
  156.         DS.W    0
  157.  
  158.  
  159. *---------------------------------------------------------------------
  160. _Expunge:
  161.         MOVE.L    _IntuitionBase,A1
  162.         LINKEXE    CloseLibrary
  163.  
  164.         MOVE.L    _GfxBase,A1
  165.         LINKEXE    CloseLibrary
  166.  
  167.         MOVE.L    _DOSBase,A1
  168.         LINKEXE    CloseLibrary
  169.  
  170.  
  171. *---------------------------------------------------------------------
  172. _Open:
  173.         MOVEQ    #0,D0
  174.         RTS
  175.  
  176.         END
  177.